The Springcache plugin allows you to easily add the following functionality to your Grails project:
- Caching of Spring bean methods (typically Grails service methods).
- Caching of page fragments generated by Grails controllers.
- Cache flushing when Spring bean methods or controller actions are invoked.
The plugin depends on the EhCache and EhCache-Web libraries.Contact
The plugin code is hosted on GitHub. Please feel free to fork the plugin and contribute patches.Please raise defects or enhancements against the Grails Springcache plugin component on the Codehaus JIRA.Questions, comments? mailto:robenergizedwork.com or better still contact me via the Grails User mailing list.
- GRAILSPLUGINS-2553 Cached methods with default arguments are not intercepted unless all the arguments are specified. Therefore the cache is completely bypassed (neither hit or missed).
- GRAILSPLUGINS-2544 Due to a bug with Grails itself query string parameters are not included in the generated cache key. This can be a serious issue if you are using pagination for example as query string parameters such as
offset
will be ignored resulting in the same cached content being served for every page. This only affects Grails version 1.3.4.
1.3
- Fixes bug where layout is not applied to cached content when applied by convention rather than explicitly declared in meta tag GRAILSPLUGINS-2541
- Adds
keyGenerator
element to @Cacheable
annotation GRAILSPLUGINS-2548
- Adds
cacheResolver
element to @Cacheable
annotation GRAILSPLUGINS-2167
- Content caching now respects cache control headers GRAILSPLUGINS-2616
- Adds ability to cache taglib output GRAILSPLUGINS-2569
- Deprecates
springcache.disabled = true
in favour of springcache.enabled = false
- Fixes bug with key generation from String parameters
- Updates ehcache-web to version 2.0.2
- Makes
SpringcacheService
methods safe no-ops when plugin is disabled GRAILSPLUGINS-2497
1.2.1
- Support primitive, array and
null
service method arguments in cache keys (thanks Luke Daley)
1.2
- Adds page fragment caching via annotations on controllers.
- Simplifies config by getting rid of caching and flushing models and having annotations refer to cache names directly.
- Adds configurable cache defaults that apply to configured caches and auto-created caches
- Removes pluggable cache implementation in favour of using EhCache.
1.1.3
- Fixes bug where an expired ehcache element whose key is still in the cache can cause the plugin to think the key still maps to a valid value.
- Allows configuration of ehcache caches directly in
Config.groovy
1.1.2
- Automatically create ehcache caches if they are not explicitly configured in
ehcache.xml
1.1.1
- Fixes bug where plugin crashes if disabled
1.1
- Complete rewrite to support Grails 1.2 and Spring 3.0.
- Requires Grails 1.2+
1.0.1
- Fixes bug where plugin causes crash if disabled when debug logging is switched on.
- Fixes compatibility with Java 1.5.
1.0
- Configure alternate caching providers via
Config.groovy
rather than having to override bean definitions in resources.groovy
- Removed dependency on joda-time which was only there for testing
- Better synchronization for getting caches from the mapcache CacheManager
0.2
- Configure caching and flushing models via
Config.groovy
- Flag to disable plugin entirely for testing environments
0.1